package com.huawei.appmarket.service.store.awk.card;

import android.content.Context;
import android.text.TextUtils;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import com.huawei.appgallery.foundation.ui.framework.cardkit.bean.CardBean;
import com.huawei.appgallery.horizontalcard.api.card.BaseHorizontalItemCard;
import com.huawei.appmarket.service.store.awk.bean.HorizonalHomeCardItemBean;
import java.util.Locale;
import o.cgz;
import o.chy;
import o.eqx;
import o.evx;
import o.ewm.h;
import o.ewm.j;
import o.ewm.n;

public class BigHorizonHomeFixedItemCard extends BaseHorizontalItemCard {
    private TextView ʻ;
    private ImageView ʼ;
    private ImageView ˋ;
    private TextView ᐝ;

    public BigHorizonHomeFixedItemCard(Context context) {
        super(context);
    }

    public cgz ˏ(View view) {
        ˊ((ImageView) view.findViewById(j.ꜞˋ));
        this.ˋ = (ImageView) view.findViewById(j.ʽˉ);
        this.ʻ = (TextView) view.findViewById(j.ˇˊ);
        this.ᐝ = (TextView) view.findViewById(j.ʿᐨ);
        this.ˊˋ = (LinearLayout) view.findViewById(j.ʿˊ);
        this.ʼ = (ImageView) view.findViewById(j.ʻߴ);
        ʽ(view);
        return this;
    }

    public void ˏ(CardBean cardBean) {
        super.ˏ(cardBean);
        if (cardBean instanceof HorizonalHomeCardItemBean) {
            HorizonalHomeCardItemBean horizonalHomeCardItemBean = (HorizonalHomeCardItemBean) cardBean;
            this.ʻ.setText(horizonalHomeCardItemBean.v_());
            this.ᐝ.setVisibility(0);
            this.ᐝ.setContentDescription(null);
            this.ʼ.setVisibility(8);
            if (horizonalHomeCardItemBean.ꞌ() == 5 && !TextUtils.isEmpty(horizonalHomeCardItemBean.ʹ())) {
                float floatValue = Float.valueOf(horizonalHomeCardItemBean.ʹ()).floatValue();
                this.ᐝ.setText(String.format(Locale.ENGLISH, "%.1f", new Object[]{Float.valueOf(floatValue)}));
                this.ᐝ.setContentDescription(this.ʼॱ.getString(n.יˊ, new Object[]{r0}));
                this.ʼ.setVisibility(0);
            } else if (horizonalHomeCardItemBean.ͺ() == 1 || horizonalHomeCardItemBean.ͺ() == 3) {
                this.ᐝ.setText(horizonalHomeCardItemBean.ॱˎ());
            } else if (TextUtils.isEmpty(horizonalHomeCardItemBean.ˏˎ())) {
                this.ᐝ.setVisibility(8);
            } else {
                this.ᐝ.setText(horizonalHomeCardItemBean.ˏˎ());
            }
            ˎ(horizonalHomeCardItemBean);
        }
    }

    private void ˎ(HorizonalHomeCardItemBean horizonalHomeCardItemBean) {
        if (TextUtils.isEmpty(horizonalHomeCardItemBean.ॱˑ())) {
            eqx.ˏ(this.ˋ, horizonalHomeCardItemBean.ॱˌ(), "app_big_icon");
        } else {
            eqx.ॱ(this.ˋ, horizonalHomeCardItemBean.ॱˑ(), "app_big_icon");
        }
        this.ˋ.setContentDescription(horizonalHomeCardItemBean.v_());
    }

    public void ॱ(final chy o_chy) {
        OnClickListener anonymousClass2 = new evx(this) {
            final /* synthetic */ BigHorizonHomeFixedItemCard ˋ;

            public void ˋ(View view) {
                o_chy.ˏ(0, this.ˋ);
            }
        };
        this.ˋ.setOnClickListener(anonymousClass2);
        ˉ().setOnClickListener(anonymousClass2);
    }

    public int ˊ() {
        return h.ꞌ;
    }

    public int ˎ() {
        return h.ꞌ;
    }
}
